# -*- coding: utf-8 -*-

# graphic-pppoe-client - Easy graphic networking manager
#
# Author: GoTLiuM InSPiRiT <gotlium@gmail.com>
#
# Copyright 2010, GoTLiuM InSPiRiT <gotlium@gmail.com>.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranties of
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
# PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program.  If not, see <http://www.gnu.org/licenses/>.

from libraries.net import getIfInfo
from models.__init__ import getIfnameByConnId, getConnectionById

class Connections(object):

	''' Reference for GDPClass '''
	gpd = None

	def __init__(self, gpd):
		self.gpd = gpd

	def infoConnection(self, id):
		return getIfInfo(getIfnameByConnId(connId))

	def reloadConnection(self, id):
		self.downConnection(connId)
		self.upConnection(connId)

	def getConnection(self, id):
		return getConnectionById(id)
